Optimal. Leaf size=144 \[ \frac{2 a^{3/2} c^2 \tan (e+f x) \tanh ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a}}\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}+\frac{2 a d (2 c+d) \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}}-\frac{2 d^2 \tan (e+f x) (a-a \sec (e+f x))}{3 f \sqrt{a \sec (e+f x)+a}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11605, antiderivative size = 144, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.148, Rules used = {3940, 88, 63, 206} \[ \frac{2 a^{3/2} c^2 \tan (e+f x) \tanh ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a}}\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a \sec (e+f x)+a}}+\frac{2 a d (2 c+d) \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}}-\frac{2 d^2 \tan (e+f x) (a-a \sec (e+f x))}{3 f \sqrt{a \sec (e+f x)+a}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3940
Rule 88
Rule 63
Rule 206
Rubi steps
\begin{align*} \int \sqrt{a+a \sec (e+f x)} (c+d \sec (e+f x))^2 \, dx &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{(c+d x)^2}{x \sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=-\frac{\left (a^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \left (\frac{d (2 c+d)}{\sqrt{a-a x}}+\frac{c^2}{x \sqrt{a-a x}}-\frac{d^2 \sqrt{a-a x}}{a}\right ) \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a d (2 c+d) \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}-\frac{2 d^2 (a-a \sec (e+f x)) \tan (e+f x)}{3 f \sqrt{a+a \sec (e+f x)}}-\frac{\left (a^2 c^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a-a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a d (2 c+d) \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}-\frac{2 d^2 (a-a \sec (e+f x)) \tan (e+f x)}{3 f \sqrt{a+a \sec (e+f x)}}+\frac{\left (2 a c^2 \tan (e+f x)\right ) \operatorname{Subst}\left (\int \frac{1}{1-\frac{x^2}{a}} \, dx,x,\sqrt{a-a \sec (e+f x)}\right )}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}\\ &=\frac{2 a d (2 c+d) \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}+\frac{2 a^{3/2} c^2 \tanh ^{-1}\left (\frac{\sqrt{a-a \sec (e+f x)}}{\sqrt{a}}\right ) \tan (e+f x)}{f \sqrt{a-a \sec (e+f x)} \sqrt{a+a \sec (e+f x)}}-\frac{2 d^2 (a-a \sec (e+f x)) \tan (e+f x)}{3 f \sqrt{a+a \sec (e+f x)}}\\ \end{align*}
Mathematica [C] time = 6.59086, size = 444, normalized size = 3.08 \[ \frac{\sqrt{\frac{1}{1-2 \sin ^2\left (\frac{1}{2} (e+f x)\right )}} \sqrt{1-2 \sin ^2\left (\frac{1}{2} (e+f x)\right )} \csc ^3\left (\frac{1}{2} (e+f x)\right ) \sec \left (\frac{1}{2} (e+f x)\right ) \sqrt{a (\sec (e+f x)+1)} (c+d \sec (e+f x))^2 \left (256 \sin ^6\left (\frac{1}{2} (e+f x)\right ) \left (-2 c \sin ^2\left (\frac{1}{2} (e+f x)\right )+c+d\right )^2 \text{HypergeometricPFQ}\left (\left \{\frac{3}{2},2,\frac{7}{2}\right \},\left \{1,\frac{9}{2}\right \},2 \sin ^2\left (\frac{1}{2} (e+f x)\right )\right )+1024 \sin ^6\left (\frac{1}{2} (e+f x)\right ) \text{Hypergeometric2F1}\left (\frac{3}{2},\frac{7}{2},\frac{9}{2},2 \sin ^2\left (\frac{1}{2} (e+f x)\right )\right ) \left (c^2 \left (2 \sin ^4\left (\frac{1}{2} (e+f x)\right )-3 \sin ^2\left (\frac{1}{2} (e+f x)\right )+1\right )+c d \left (2-3 \sin ^2\left (\frac{1}{2} (e+f x)\right )\right )+d^2\right )-\frac{7 \sqrt{2} \left (\sqrt{2} \sqrt{\sin ^2\left (\frac{1}{2} (e+f x)\right )} \sqrt{1-2 \sin ^2\left (\frac{1}{2} (e+f x)\right )} \left (4 \sin ^2\left (\frac{1}{2} (e+f x)\right )+3\right )-3 \sin ^{-1}\left (\sqrt{2} \sqrt{\sin ^2\left (\frac{1}{2} (e+f x)\right )}\right )\right ) \left (c^2 \left (12 \sin ^4\left (\frac{1}{2} (e+f x)\right )-20 \sin ^2\left (\frac{1}{2} (e+f x)\right )+15\right )+10 c d \left (3-2 \sin ^2\left (\frac{1}{2} (e+f x)\right )\right )+15 d^2\right )}{\sqrt{\sin ^2\left (\frac{1}{2} (e+f x)\right )}}\right )}{672 f \sec ^{\frac{5}{2}}(e+f x) (c \cos (e+f x)+d)^2} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.272, size = 248, normalized size = 1.7 \begin{align*}{\frac{1}{6\,f\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }\sqrt{{\frac{a \left ( 1+\cos \left ( fx+e \right ) \right ) }{\cos \left ( fx+e \right ) }}} \left ( 3\,\sqrt{2}\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) \left ( -2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }} \right ) ^{3/2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{2}\sin \left ( fx+e \right ) }{\cos \left ( fx+e \right ) }\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}} \right ){c}^{2}+3\,\sqrt{2} \left ( -2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }} \right ) ^{3/2}{\it Artanh} \left ( 1/2\,{\frac{\sqrt{2}\sin \left ( fx+e \right ) }{\cos \left ( fx+e \right ) }\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}} \right ){c}^{2}\sin \left ( fx+e \right ) -24\, \left ( \cos \left ( fx+e \right ) \right ) ^{2}cd-8\, \left ( \cos \left ( fx+e \right ) \right ) ^{2}{d}^{2}+24\,\cos \left ( fx+e \right ) cd+4\,\cos \left ( fx+e \right ){d}^{2}+4\,{d}^{2} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.3009, size = 819, normalized size = 5.69 \begin{align*} \left [\frac{3 \,{\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \sqrt{-a} \log \left (\frac{2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt{-a} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) + 2 \,{\left (d^{2} + 2 \,{\left (3 \, c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{3 \,{\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}, -\frac{2 \,{\left (3 \,{\left (c^{2} \cos \left (f x + e\right )^{2} + c^{2} \cos \left (f x + e\right )\right )} \sqrt{a} \arctan \left (\frac{\sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt{a} \sin \left (f x + e\right )}\right ) -{\left (d^{2} + 2 \,{\left (3 \, c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{3 \,{\left (f \cos \left (f x + e\right )^{2} + f \cos \left (f x + e\right )\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a \left (\sec{\left (e + f x \right )} + 1\right )} \left (c + d \sec{\left (e + f x \right )}\right )^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]